@extends('default.mobile.layouts.personalPublic')
@section('title','求职意向-'.Site::get('webname'))
{{--首页css--}}
@section('headcss')
    @parent
    <link rel="stylesheet" href="{{asset('/default/css/mobile/personal/common.css')}}">
    <link rel="stylesheet" href="{{asset('/default/css/mobile/jquery/select.css')}}">
@endsection
{{--头部标签--}}
@section('tag','求职意向')
@section('link') href="{{url('mobile/personal/resume_manage?parameter=objective&resume_id='.$resume->id)}}" @endsection

{{--主体内容--}}
@section('content')
    <div class="fill" id="fill" style="overflow: hidden">
        <div class="form_info" id="form_info">
            <form action="{{url('mobile/personal/resume_objective')}}"
                  onsubmit="return checkObjective('#objectiveForm')" method="post" id="objectiveForm"
                  name="objectiveForm">
                {{csrf_field()}}
                <input type="hidden" name="resume_id" id="resume_id" value="{{$resume->id}}">
                <dl>
                    <dt>意向岗位<span class="asterisk">*</span></dt>
                    <dd><input type="text" name="intentionjobs" id="intentionjobs" value="{{$resume->intentionjobs}}"
                               placeholder="请输入意向岗位" autocomplete="off"></dd>
                </dl>
                <dl class="arrow" id="jobarea_select">
                    <input type="hidden" name="jobarea1" value="{{$resume->jobarea1}}" id="jobarea1"/>
                    <input type="hidden" name="jobarea2" value="{{$resume->jobarea2}}" id="jobarea2"/>
                    <input type="hidden" name="jobarea3" value="{{$resume->jobarea3}}" id="jobarea3"/>
                    <input type="hidden" name="jobarea4" value="{{$resume->jobarea4}}" id="jobarea4"/>
                    <input type="hidden" name="jobarea5" value="{{$resume->jobarea5}}" id="jobarea5"/>
                    <dt>工作地区<span class="asterisk">*</span></dt>
                    <dd><span class="select_text">请选择工作地区</span></dd>
                </dl>
                <dl class="arrow" id="jobsort_select">
                    <input type="hidden" name="jobsort1" value="{{$resume->jobsort1}}" id="jobsort1"/>
                    <input type="hidden" name="jobsort2" value="{{$resume->jobsort2}}" id="jobsort2"/>
                    <input type="hidden" name="jobsort3" value="{{$resume->jobsort3}}" id="jobsort3"/>
                    <input type="hidden" name="jobsort4" value="{{$resume->jobsort4}}" id="jobsort4"/>
                    <input type="hidden" name="jobsort5" value="{{$resume->jobsort5}}" id="jobsort5"/>
                    <dt>期望职位<span class="asterisk">*</span></dt>
                    <dd><span class="select_text">请选择期望职位</span></dd>
                </dl>
                <dl class="arrow" id="expectedsalary_select">
                    <input type="hidden" name="expectedsalary" value="{{$resume->expectedsalary}}" id="expectedsalary"/>
                    <dt>期望薪资</dt>
                    <dd><span class="select_text">请选择期望薪资</span></dd>
                </dl>
                <div class="form_sub"><input type="submit" value="保存"></div>
            </form>
        </div>
    </div>
@endsection


@section('footerjs')
    @parent
    <script type="text/javascript" src="{{asset('/default/js/mobile/jquery/jquery.select.js')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/mobile/jquery/jquery.select_many.js')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/mobile/jquery/jquery.select_position.js')}}"></script>
    <script type="text/javascript" src="{{Resources::jsOption(['expectedsalary'])}}"></script>
    <script type="text/javascript" src="{{Resources::jsProvinceArea()}}"></script>
    <script type="text/javascript" src="{{Resources::jsOnePosition()}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/mobile/personal/resume_manage.js')}}"></script>
    <script>
        var _token = '{{csrf_token()}}';
        $(function(){
            var fill = $("#fill").find('#form_info');
            //期望薪资
            option_expectedsalary.unshift({'value': 0, 'text': '面议'});
            fill.find("#expectedsalary_select").select({
                select_title: '期望薪资',                //标题值
                hidden: '#expectedsalary',                   //select隐藏表单值
                opt_data: option_expectedsalary          //select选项值（数组json对象）
            });
            //多选工作地区选择
            fill.find("#jobarea_select").select_many({
                select_title: '工作地区',
                selectArr: ['#jobarea1', '#jobarea2', '#jobarea3', '#jobarea4', '#jobarea5'],
                opt_city: (typeof(option_town) != 'undefined') ? option_town_second : (typeof(option_city) != 'undefined') ? option_city_two : [],
                opt_province: option_province
            });
            //多选职位选择
            fill.find("#jobsort_select").select_position({
                select_title: '职位类别',
                selectArr: ['#jobsort1', '#jobsort2', '#jobsort3', '#jobsort4', '#jobsort5'],
                opt_position: option_position
            });
        });

        //错误信息提示
                @if(count($errors)>0)
                @if(is_object($errors))
        var msgErr = '';
        @foreach($errors->all() as $error)
                msgErr += "<p style='line-height: .4rem; width: 100%'>{{$error}};</p>";
        @endforeach
        layerMsg(msgErr, 10);
        @endif
        @endif
    </script>
@endsection